<template>
	<view>
		<uni-card title="用途">
			<view>对api的定义和调用进行集中管理，便于后续的更新维护。</view>
		</uni-card>
		
		<uni-card title="介绍">
			<view>源代码位于：/common/api.js</view>
		</uni-card>
		
		<uni-card title="使用样例">
			<button
			  type="primary"
			  block
			  @tap="callApiTest"
			>接口调用测试</button>
			<view>返回数据为：</view>
			<view style="word-break: break-all;">{{ respData }}</view>
		</uni-card>
	</view>
</template>

<script>
	import { callApi } from '../../../common/api'
	export default {
		data() {
			return {
				respData: null
			}
		},
		onLoad() {

		},
		methods: {
			async callApiTest () {
			    const data = await callApi('getCaptcha')
			    this.respData = JSON.stringify(data)
			}
		}
	}
</script>

<style></style>
